package com.baidu.threadPoolExcutor;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class ApplicationPoolExecutors {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //1.executors创建线程池
        ExecutorService pool = Executors.newFixedThreadPool(5);

        //2.创建线程对象
        Future<String> submit = pool.submit(new MyCallable(10));
        System.out.println(submit.get());


    }
}
